package com.htgd.gardenexpo.controller;

import com.github.pagehelper.PageInfo;
import com.htgd.gardenexpo.entity.CommonResult;
import com.htgd.gardenexpo.page.CritiqueQuery;
import com.htgd.gardenexpo.service.GeConSocialCritiqueService;
import com.htgd.gardenexpo.vo.GeConCritiqueVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author: 王秀田
 * @date: 2024/11/8 14:52
 * @description: 社交内容评论 前端控制器
 */
@Slf4j
@RestController
@RequestMapping("/api/socialCritique")
@Api(tags = "社交内容评论")
public class GeConSocialCritiqueController {

    @Autowired
    private GeConSocialCritiqueService geConSocialCritiqueService;

    @GetMapping(value = "/list")
    @ApiOperation("查询")
    public CommonResult<List<GeConCritiqueVO>> list(CritiqueQuery critiqueQuery) {
        PageInfo<GeConCritiqueVO> list = geConSocialCritiqueService.pageList(critiqueQuery);
        return CommonResult.success(String.valueOf(list.getTotal()),list.getList());
    }

}
